package com.example.poemtest.mine;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.example.poemtest.R;
import com.example.poemtest.utils.FullScreenUtil;

/**
 * 账号与安全页面
 */
public class SetupSafe extends AppCompatActivity implements View.OnClickListener {

    private ImageView setupSafeToMine;
    private RelativeLayout changePassword;
    private LinearLayout logoff;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        FullScreenUtil.getInstance().fullScreen(this,true);
        setContentView(R.layout.activity_setup_safe);
        //绑定控件对象
        setView();
    }

    /**
     * 绑定控件对象
     */
    private void setView() {
        setupSafeToMine = findViewById(R.id.setup_safe_to_mine);
        setupSafeToMine.setOnClickListener(this);
        changePassword = findViewById(R.id.changePassword);
        changePassword.setOnClickListener(this);
        logoff = findViewById(R.id.logoff);
        logoff.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.setup_safe_to_mine:
                //跳转到设置页面
                Intent intent = new Intent(SetupSafe.this, SetupActivity.class);
                startActivity(intent);
                break;
            case R.id.changePassword:
                //跳转到修改密码页面
                Intent intent1 = new Intent(SetupSafe.this, ChangePassword.class);
                startActivity(intent1);
                break;
            case R.id.logoff:
                //跳转到注销页面
                Intent intent2 = new Intent(SetupSafe.this, BeforeLayOff.class);
                startActivity(intent2);
                break;
        }
    }
}